package com.example.weixinauth.feign;

import com.weixin.common.core.domain.Result;
import com.weixin.common.core.form.LoginForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @version 1.0.0
 * @className: FeignLoginService
 * @description: 登录服务
 * @author: zhangjunfa
 * @date: 2023/6/19 16:17
 */
@FeignClient(name = "weixin-system")
public interface FeignLoginService {
    /**
     * 登录服务
     *
     * @param loginForm 登录参数
     * @return
     */
    @PostMapping("/login")
    Result<?> login(LoginForm loginForm);

    /**
     * 退出登录
     *
     * @param request 退出登录
     * @return
     */
    @PostMapping("/logout")
    Result<?> logout(HttpServletRequest request);

    /**
     * 注册
     *
     * @param loginForm 注册参数
     * @return
     */
    @PostMapping("/register")
    Result<?> register(LoginForm loginForm);

    /**
     * 刷新token
     *
     * @param request 请求头
     * @return
     */
    Result<?> refreshToken(HttpServletRequest request);
}
